package cn.wenhe9.yygh.hosp.repository;

import cn.wenhe9.yygh.model.hosp.Hospital;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

/**
 * @author DuJinliang
 * 2022/2/18
 */
@Repository
public interface HospitalRepository extends MongoRepository<Hospital, String> {
    /**
     * 判断是否存在数据
     * @param hoscode String
     * @return Hospital
     */
    Optional<Hospital> findHospitalByHoscode(String hoscode);

    /**
     * 根据医院名称模糊查询
     * @param hosname String
     * @return List<Hospital>
     */
    List<Hospital> findHospitalsByHosnameLike(String hosname);
}
